package com.learn.proxy;

import java.lang.reflect.Proxy;

/**
 * @author chenxin
 * @time 2017-02-15-09:15
 */
public class ProxyTest {
    public static void main(String[] args) {
        Target target = new TargetImpl();
        Target tt = (Target) Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(), new TargetProxy(target));
        tt.bar();
        tt.foo();
    }
}
